

#pragma once
#include "stdafx.h"
#include "LearnNode.h"
 
class KnowledgeContent
{
public:
	PROPERTY(LearnNodePtr, m_nodePtr, LearnNodePtr);
	PROPERTY_BY_REF(std::string, m_nodeName, NodeName);
	PROPERTY_BY_REF(std::string, m_chapterName, ChapterName);
};
typedef std::shared_ptr<KnowledgeContent> KnowledgeContentPtr;

class LearnMgr : public Singleton<LearnMgr>
{
public:
	LearnMgr();
	virtual ~LearnMgr() = default;

protected:
	void init();

public:
	KnowledgeContentPtr getKnowledgeContent(const KnowledgeNode& kNode = KnowledgeNode::None)
	{
		auto node = kNode == KnowledgeNode::None ? KNOWLEDGE_NODE_RUNNING : kNode;
		auto it = m_map.find(node);
		assert(it != m_map.end());
		return it->second;
	}

protected:
	std::map<KnowledgeNode, KnowledgeContentPtr> m_map;
};
